function allCheckRules(that, formName, index) {
  let result
  result = new Promise((resolve, reject) => {
    if (index) {
      that.$refs[formName][(index - 1)].validate((valid) => {
        if (valid) {
          resolve();
        } else { reject() }
      })
    } else {
      that.$refs[formName].validate((valid) => {
        if (valid) {
          resolve();
        } else { reject() }
      })
    }
  })
  return result
}
// export default {
//   allCheckRules
// }
module.exports = {
  allCheckRules
}